home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / datelib.exe / TOMORROW.C < prev    next >
C/C++ Source or Header  |  1992-03-27  |  2KB  |  54 lines

  1. static char tomorrow_prog[] = "@(#)Morgiges Datum ermitteln";
  2. static char tomorrow_ver[]  = "@(#)v1.00/kr ; 14.04.91";
  3. /* tomorrow     Ermitteln des morgigen Datums.
  4. **
  5. ** Autor        Klaus Rath
  6. **
  7. ** Deklaration  char *tomorrow(int format);
  8. **
  9. ** Beschreibung Die Funktion gibt per today und calcdate  "morgen"
  10. **              im gewünschten Format zurück. Die aufrufende Funktion muß
  11. **              deshalb sicherstellen, daß ein char-Array ausreichender
  12. **              Größe definiert ist, oder sich zum Aufrufzeitpunkt genügend
  13. **              Speicherplatz per malloc besorgen.
  14. **              Erlaubte Formate, ihre Ausprägung und ihre Arraylänge:
  15. **              1                 tt.mm.jj            9
  16. **              2                 mm/tt/jj            9
  17. **              3                 jjmmtt              7
  18. **              4                 tt.mm.jjjj          11
  19. **              5                 mm/tt/jjjj          11
  20. **              6                 jjjjmmtt            9
  21. **              7                 tt.mm.              7
  22. **              8                 mm/tt               6
  23. **              Im Fehlerfall gibt today einen (char *)NULL zurück!
  24. **
  25. ** Änderungen   1.00 ; 14.04.91
  26. **              - Erste Version
  27. */
  28.  
  29. #include <stdio.h>
  30. #include <string.h>
  31. #ifdef __TURBOC__
  32. #define ANSI
  33. #define MSDOS
  34. #include <stdlib.h>
  35. #endif
  36. #include "datum.h"
  37.  
  38. #ifdef ANSI
  39. char *tomorrow(int format)
  40. #else
  41. char *tomorrow(format)
  42. int format;
  43. #endif
  44. {
  45.     char      buf[11];
  46.     char      rueckgabe[11];
  47.  
  48.     strcpy(buf,today(format));
  49.     calcdate(buf,1L,rueckgabe);
  50.  
  51.     return(rueckgabe);
  52.  
  53. } /* ENDE: tomorrow() */
  54.